package com.xiaomaoguai.observer.jdk;

import java.util.Observable;

/**
 * @ FileName: Watched.java
 * @ Author: WeiHui-Z
 * @ Date: 2017/4/25 15:03
 * @ Version: v1.0.0
 */
public class Watched extends Observable {

    private String data = "";

    public String getData() {
        return data;
    }

    public void setData(String data) {
        if (!this.data.equals(data)) {
            this.data = data;
            setChanged();
        }
        notifyObservers();
    }

}
